﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Base;
using BrokerBase.Lib.Core;
using BrokerBase.Lib.Policy;
using BrokerBase.Lib.Tool;

namespace BrokerBase.Lib.Person
{
    public class Person:PKItem,IPerson
    {
       
        public virtual SexType Sex { get; set; }

        public virtual string IdCardNo { get; set; }

        public virtual DateTime Birthday { get; set; }

        public virtual int Age

        {
            get { return PersonUtil.GetAgeFromBirthdayAndTime(this.Birthday, DateTime.Now); }
            set { Birthday = System.DateTime.Now.AddYears(value * -1); }
        }

        public virtual string Title { get; set; }

        public virtual string Mobile { get; set; }

        public virtual string HomePhone { get; set; }

        public virtual string WorkPhone { get; set; }

        public virtual string QQ { get; set; }

        public virtual string WeiXin { get; set; }

        public virtual string Msn { get; set; }

        public virtual string Wangwang { get; set; }

        public virtual string WeiBo { get; set; }

        public virtual string EMail { get; set; }

        public virtual string HomeAddress { get; set; }

        public virtual string WorkAddress { get; set; }

        public virtual string Organization { get; set; }

        public virtual string Department { get; set; }

        public virtual string Position { get; set; }

        public virtual double AnnualIncome { get; set; }

       
        public virtual string Hobby { get; set; }

        public virtual byte[] Photo { get; set; }


        //public virtual int GetAgeByYear(DateTime time)
        //{
        //    int age = time.Year - Birthday.Year;

        //    if (time.Month < Birthday.Month)
        //    {
        //        age--;
        //    }
        //    else if (Birthday.Month == time.Month)
        //    {
        //        if (time.Day < Birthday.Day)
        //        {
        //            age--;
        //        }
        //    }
        //    return age;
        //}

        public virtual IList<IScheme> Schemes { get; set; }


        public virtual string Job { get; set; }
        /// <summary>
        /// 关注度
        /// </summary>
        public virtual int Attention { get; set; }


    }
}
